﻿using SLNGP.Core.Genes;

namespace SLNGP.Core.SecondaryStrategies
{
    public class EqualProbablityRandomGeneSelection : GPStrategy, ISelectRandomGeneDefinition
    {
        public IGeneDefinition SelectRandomDefinition()
        {
            int selectedIndex = Parent.GetStrategy<IRandomProvider>().Random(0, Parent.PossibleGenes.Count - 1);
            return Parent.PossibleGenes[selectedIndex];
        }
    }
}